function(addMacroDefinition)
    set(prefix ARG)
    set(noValues)
    set(singleValues TARGET MacroName Comment OptionHint Scope)
    set(multiValues Options)
    cmake_parse_arguments(${prefix} "${noValues}" "${singleValues}" "${multiValues}" ${ARGN})
    if(NOT TARGET ${${prefix}_TARGET})
        message(FATAL_ERROR "Target ${${prefix}_TARGET} does not exist")
    endif()

    if(DEFINED ${${prefix}_Options})
        list(FIND ${${prefix}_Options} ${${prefix}_MacroName} index)
    else()
        set(index 0)
    endif()

    if(${index} EQUAL -1)
        message(FATAL_ERROR ${${prefix}_OptionHint})
    else()
        target_compile_definitions(${${prefix}_TARGET} ${${prefix}_Scope} ${${prefix}_MacroName})
        MESSAGE(STATUS "${${prefix}_Comment}")
    endif()
endfunction()